package com.service.impl;



import com.entity.Phone;
import com.repository.PhoneRepository;
import com.service.PhoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.security.RolesAllowed;
import java.util.List;

/**
 * @author Yadasu
 * @date 2020/12/17 11:12
 */
@Service
public class PhoneServiceImpl implements PhoneService {
    @Autowired
    private PhoneRepository repository;
    @Override
    @RolesAllowed("ROLE_ADMIN")
    public List<Phone> allPhones() {
        return repository.findAll();
    }
}
